/*
 * @Author: mikey.zhaopeng 
 * @Date: 2019-01-01 16:16:46 
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2019-01-01 23:43:32
 */
import 'package:flutter/material.dart';
import '../constants.dart' show AppColors, AppFontSize;

class DiscountItem extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      child: Container(
        padding: const EdgeInsets.all(15.0),
        decoration: BoxDecoration(
          border: Border(
            bottom: BorderSide(
              width: 1.0,
              color: Color(AppColors.jpItemBorderColor),
            ),
          ),
        ),
        child: Row(
          children: <Widget>[
            Container(
              width: 64.0,
              height: 64.0,
              margin: const EdgeInsets.only(right: 10.0),
              decoration: BoxDecoration(
                borderRadius: BorderRadius.all(
                  Radius.circular(5.0),
                ),
              ),
              child: FadeInImage(
                placeholder: AssetImage('assets/images/home/icon@3x.png'),
                image: AssetImage('assets/images/home/icon@3x.png'),
              ),
            ),
            Expanded(
              flex: 1,
              child: Container(
                height: 64.0,
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: <Widget>[
                    Container(
                      // padding: const EdgeInsets.only(bottom: 4.0),
                      child: Row(
                        children: <Widget>[
                          Text(
                            "新水浒",
                            style: TextStyle(
                                fontSize: 14.0, color: Color(0xff333333)),
                          ),
                          Container(
                            width: 44.0,
                            height: 18.0,
                            margin: const EdgeInsets.only(left: 10.0),
                            padding: const EdgeInsets.only(left: 6.0),
                            alignment: Alignment.center,
                            decoration: BoxDecoration(
                                image: DecorationImage(
                                    image:
                                        AssetImage('assets/images/game/a.png'),
                                    fit: BoxFit.cover)),
                            child: Text(
                              '8.5',
                              style: TextStyle(
                                  color: Colors.white, fontSize: 12.0),
                            ),
                          )
                        ],
                      ),
                    ),
                    Row(
                      children: <Widget>[
                        Container(
                          margin: const EdgeInsets.only(right: 5.0),
                          child: Image.asset(
                            'assets/images/home/i@3x.png',
                            height: 12.0,
                            width: 12.0,
                          ),
                        ),
                        Text(
                          '8.5',
                          style: TextStyle(
                            fontSize: 12.0,
                            color: Color(0xffffb223),
                          ),
                        ),
                        Container(
                          height: 12.0,
                          width: 1.0,
                          color: Color(0xff999999),
                          margin: const EdgeInsets.only(left: 5.0, right: 5.0),
                        ),
                        Text(
                          '139M·仙侠',
                          style: TextStyle(
                            fontSize: 12.0,
                            color: Color(0xff999999),
                          ),
                        ),
                      ],
                    ),
                    Container(
                      padding: const EdgeInsets.only(right: 10.0),
                      child: Text(
                        '儿女情长千里姻缘等你来牵儿女情长千里姻缘等你来牵儿女情长千里姻缘等你来牵儿女情长千里姻缘等你来牵',
                        overflow: TextOverflow.ellipsis,
                        style: TextStyle(
                          fontSize: 12.0,
                          color: Color(0xff999999),
                        ),
                      ),
                    ),
                  ],
                ),
              ),
            ),
            Container(
              height: 28.0,
              width: 56.0,
              child: OutlineButton(
                highlightElevation: 4,
                padding: const EdgeInsets.all(0),
                borderSide: BorderSide(
                  color: Color(0xff1faed6),
                ),
                color: Color(0xffffffff),
                textColor: Color(0xff1faed6),
                onPressed: () {},
                child: Text(
                  '详情',
                  style: TextStyle(fontSize: 14.0),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}

class GameType extends StatelessWidget {
  final String name;
  GameType({Key key, @required this.name}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.symmetric(horizontal: 5.0, vertical: 0.0),
      margin: const EdgeInsets.only(right: 5.0),
      decoration: BoxDecoration(
          border: Border.all(
            width: 1.0,
            color: Color(0xfffe5ba8),
          ),
          borderRadius: BorderRadius.all(
            Radius.circular(4.0),
          )),
      child: Text(
        name,
        style: TextStyle(fontSize: 12.0),
      ),
    );
  }
}
